
#include <Probability.h>

Probability::Probability(float probabilityOfEventA, float probabilityOfEventB)
    : _p1(probabilityOfEventA),
      _p2(probabilityOfEventB)
{
}

float Probability::twoEventsOccurInSameTime() const
{
    return _p1 * _p2;
}

float Probability::anyEventOccurs() const
{
    return 1 - (1 - _p1) * (1 - _p2);
}

float Probability::eventAWontOccur() const
{
    return 1 - _p1;
}

